<?php
require_once("../../controllers/init.php");
//echo "Filesystem root = ".$FILE_SYSTEM_ROOT."\n<br>";
require_once($FILE_SYSTEM_ROOT."/controllers/authentication.php");
//echo "logged on - ".(($IS_LOGGED_ON)?"true\n":"false\n");

// get all users

$users = $GLOBALS['USEREMAILS'];
//print_r ($users);
$size = sizeof($users);

$usersSelect = "<select id=\"messaging-recipients-select\" multiple size=\"".$size."\">\n";

foreach ($users as $user) 
{
	$usersSelect .= "<option value=\"".$user['SnapUserID']."\" selected>".$user['LongName']." (".$user['email'].")</option>";
}

$usersSelect .= "</select>";

?>

<span id="messaging-recipients">
	<h2>Recipients</h2>
	<span id="messaging-recipients-list"><?php echo $usersSelect; ?></span>
	<p>Click to select a single address, shift-click to select a range, control-click to select/deselect individual addresses.</p>
	<br><br><br>
	<?php require "../../views/menus/messaging.php"; ?>

</span>
<span id="messaging-message">
	<h2>Message</h2>
	<textarea placeholder="Enter message" id="messaging-message-text"></textarea>
</span>

